A Simple Linear-Space Data Structure for Constant-Time Range Minimum Query
نویسنده
چکیده
We revisit the range minimum query problem and present a new O(n)-space data structure that supports queries in O(1) time. Although previous data structures exist whose asymptotic bounds match ours, our goal is to introduce a new solution that is simple, intuitive, and practical without increasing asymptotic costs for query time or space.
منابع مشابه
Range Minimum Queries: Simple and Optimal, At Last!
For an array A of n objects from a totally ordered universe, a range minimum query rmqA(i, j) asks for the position of the minimum element in the sub-array A[i, j]. This fundamental algorithmic problem has applications in string processing, text indexing, text compression, document retrieval, and graphor tree-navigation, just to name a few. We focus on the setting where the array A is static an...
متن کاملFinding Range Minima in the Middle: Approximations and Applications
A Range Minimum Query asks for the position of a minimal element between two specified array-indices. We consider a natural extension of this, where our further constraint is that if the minimum in a query interval is not unique, then the query should return an approximation of the median position among all positions that attain this minimum. We present a succinct preprocessing scheme using Dn+...
متن کاملLecture 15 — April 12 , 2012
In this lecture, we look at various data structures to solve problems about static trees: given a static tree, we perform some preprocessing to construct our data structure, then use the data structure to answer queries about the tree. The three problems we look at in this lecture are range minimum queries (RMQ), lowest common ancestors (LCA), and level ancestor (LA); we will support all these ...
متن کاملRange Majority in Constant Time and Linear Space
Given an array A of size n, we consider the problem of answering range majority queries: given a query range [i..j] where 1 ≤ i ≤ j ≤ n, return the majority element of the subarray A[i..j] if it exists. We describe a linear space data structure that answers range majority queries in constant time. We further generalize this problem by defining range α-majority queries: given a query range [i..j...
متن کاملApproximating the Minimum Closest Pair Distance and Nearest Neighbor Distances of Linearly Moving Points
Given a set of n moving points in R, where each point moves along a linear trajectory at arbitrary but constant velocity, we present an Õ(n)-time algorithm to compute a (1 + )-factor approximation to the minimum closest pair distance over time, for any constant > 0 and any constant dimension d. This addresses an open problem posed by Gupta, Janardan, and Smid [12]. More generally, we consider a...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013